package com.zlc.common.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 */
@Data
public class BaseEntity{

    @TableId(value = "id_")
    private String id;

    @TableField(value = "version_")
    @Version
    private Integer version;

    @TableField(value = "create_user_",fill = FieldFill.INSERT)
    private String createUser;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(example = "2020-10-01 12:18:48")
    @TableField(value = "create_time_",fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_user_",fill = FieldFill.UPDATE)
    private String updateUser;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(example = "2020-10-01 12:18:48")
    @TableField(value = "update_time_",fill = FieldFill.UPDATE)
    private Date updateTime;

    @TableField(value = "delete_flag_")
    @TableLogic(delval = "1",value = "0")
    private Boolean deleteFlag = Boolean.FALSE;


}
